#include <sys/types.h>
#include <sys/stat.h>
#include<iostream>
#include <fcntl.h>
#include<unistd.h>
#include "comm.hpp"
using namespace std;

class Client
{
public:
    Client()
    {
        _fd=::open(gpipepath.c_str(),O_WRONLY);//成功返回描述符，失败返回-1    
       
    }

    bool writepipe()
    {
        int tmp;
        cout<<"please input: ";
        cin>>tmp;
        int n=::write(_fd,&tmp,sizeof tmp);//成功返回写字符个数，失败-1
        if(n==-1)
        {
            cout<<"write error"<<endl;
            return false;
        }
        return true;
    }

private:
    int _fd;

};
